<?php

namespace App\Model\Report;

use App\Model\Model;
use Carbon\Carbon;

class BigDeviceEvent extends Model
{
    protected ?string $table = "big_device_event";

    public static function insertData($projectId, $appId, $channelType, $channel, $version, $oaid, $adId,
                                      $adName, $adPlanId, $adPlanName, $eventType): void
    {
        if (empty($oaid)) {
            return;
        }

        self::create([
            'project_id'   => $projectId,
            'app_id'       => $appId,
            'channel_type' => $channelType,
            'channel'      => $channel,
            'version'      => $version,
            'oaid'         => $oaid,
            'ad_id'        => $adId,
            'ad_name'      => $adName,
            'ad_plan_id'   => $adPlanId,
            'ad_plan_name' => $adPlanName,
            'event_type'   => $eventType,
            'date'         => Carbon::today()->toDateString(),
        ]);
    }
}